import { composeFormat } from './utils';

export const selectionIDPrefix = '$__uuid:';

export const BasePickInputRJSFFormat = {
  PickVertex: 'PickVertex',
  MultiPickVertex: 'MultiPickVertex',
  PickLine: 'PickLine',
  // PickCurve包括PickLine
  PickCurve: 'PickCurve',
  MultiPickCurve: 'MultiPickCurve',
  // PickSurface包括PickPlane
  PickSurface: 'PickSurface',
  PickPlane: 'PickPlane',
  MultiPickFace: 'MultiPickFace',
  MultiPickPlane: 'MultiPickPlane',
  // 选择体
  PickModel: 'PickModel',
  MultiPickModel: 'MultiPickModel',
  // 选择坐标系
  PickFrame: 'PickFrame',
  PickSketchCurve: 'PickSketchCurve',
  MultiPickSketch: 'MultiPickSketch',
  PickSketch: 'PickSketch',
  PickALL: 'PickALL',
  MultiPickALL: 'MultiPickALL',
  // 选择法则曲线
  PickLawCurve: 'PickLawCurve',
  // 拾取零件/子装配
  PickProduct: 'PickProduct',
  MultiPickProduct: 'MultiPickProduct',
  // 零件中的阵列
  PickPartArray: 'PickPartArray',
  MultiPickPartArray: 'MultiPickPartArray',
} as const;

export const PickInputRJSFFormat = {
  ...BasePickInputRJSFFormat,
  // 选择封闭轮廓
  MultiPickContours: composeFormat([
    BasePickInputRJSFFormat.MultiPickCurve,
    BasePickInputRJSFFormat.MultiPickPlane,
    BasePickInputRJSFFormat.MultiPickSketch,
  ]),
  PickSketchLine: composeFormat([
    BasePickInputRJSFFormat.PickLine,
    BasePickInputRJSFFormat.PickSketch,
  ]),
  PickSketchCurve: composeFormat([
    BasePickInputRJSFFormat.PickCurve,
    BasePickInputRJSFFormat.PickSketch,
  ]),
  MultiPickSketchCurve: composeFormat([
    BasePickInputRJSFFormat.MultiPickCurve,
    BasePickInputRJSFFormat.MultiPickSketch,
  ]),
  // 选取直线/平面
  PickDirection: composeFormat([
    BasePickInputRJSFFormat.PickLine,
    BasePickInputRJSFFormat.PickPlane,
  ]),
  //选取比vertex 高的维度的图形(直线线,曲线，平面，曲面)
  PickHigherDimensionOrVertex: composeFormat([
    BasePickInputRJSFFormat.MultiPickCurve,
    BasePickInputRJSFFormat.MultiPickFace,
  ]),
  PickVertexOrLineOrFaceOrModelOrArray: composeFormat([
    BasePickInputRJSFFormat.PickVertex,
    BasePickInputRJSFFormat.PickCurve,
    BasePickInputRJSFFormat.PickSurface,
    BasePickInputRJSFFormat.PickModel,
    BasePickInputRJSFFormat.PickPartArray,
  ]),
  PickCurveSurface: composeFormat([
    BasePickInputRJSFFormat.PickCurve,
    BasePickInputRJSFFormat.PickSurface,
  ]),
  // 封闭轮廓和平面
  PickCurveAndPlane: composeFormat([
    BasePickInputRJSFFormat.PickCurve,
    BasePickInputRJSFFormat.PickPlane,
    BasePickInputRJSFFormat.PickSketch,
  ]),
  PickVertexAndFace: composeFormat([
    BasePickInputRJSFFormat.PickVertex,
    BasePickInputRJSFFormat.PickSurface,
  ]),
  // 用于轴旋转坐标系的参考，允许点、直线和平面
  PickFrameReference: composeFormat([
    BasePickInputRJSFFormat.PickVertex,
    BasePickInputRJSFFormat.PickLine,
    BasePickInputRJSFFormat.PickPlane,
  ]),
} as const;

export enum NumberInputFormat {
  Length = 'Length',
  Angle = 'Angle',
  Real = 'Real',
  Integer = 'Integer',
}

export const NONE_TITLE_UISCHEMA = {
  'ui:options': {
    label: false,
  },
  'ui:classNames': 'rjsf_no-title-field',
};
